package com.miracle.设计模式.创建型模式.简单工厂;

public class 简单工厂 {
    public static void main(String[] args) {
        Calculator calculator;
        calculator = CalculatorFactory.createCalculator("add");
        calculator = CalculatorFactory.createCalculator("sub");

        Double result;
        result = calculator.getResult(3d, 5d);
        System.out.println(result);
    }
}
